import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import p003 from './p003';
import p004 from './p004';
import p005 from './p005';
import p006 from './p006';
import p007 from './p007';
import p010 from './p010';
import p011 from './p011';
import p012 from './p012';
export default async function a001(fd: IFeidaoAiBrowserComponent) {
	// todo
	const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="add"]');
	n.removeAttribute('class');
	const name = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s001', {});
	render(fd, name.data[0], p001, 'p001', 'inner');
	const t1 = '固定资产类型';
	const title = await nodejs<Array<{ value_no: string }>>('device-management-ygh/zj-000009/s003', { value_title: t1 });
	const no = title[0].value_no;
	const type = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s004', { value_no: no });
	render(fd, type.data[0], p003, 'p003', 'inner');
	const t2 = '设备状态';
	const stage = await nodejs<Array<{ value_no: string }>>('device-management-ygh/zj-000009/s003', { value_title: t2 });
	const sta = stage[0].value_no;
	const ss = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s004', { value_no: sta });
	render(fd, ss.data[0], p004, 'p004', 'inner');
	const t3 = '所在区域';
	const ar = await nodejs<Array<{ value_no: string }>>('device-management-ygh/zj-000009/s003', { value_title: t3 });
	const place = ar[0].value_no;
	const pp = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s004', { value_no: place });
	render(fd, pp.data[0], p005, 'p005', 'inner');
	const t4 = '安全等级标识';
	const safe = await nodejs<Array<{ value_no: string }>>('device-management-ygh/zj-000009/s003', { value_title: t4 });
	const sa = safe[0].value_no;
	const safy = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s004', { value_no: sa });
	render(fd, safy.data[0], p006, 'p006', 'inner');
	const cmpy = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s005', {});
	render(fd, cmpy.data[0], p007, 'p007', 'inner');
	const pepl = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s007', {});
	render(fd, pepl.data[0], p010, 'p010', 'inner');
	render(fd, pepl.data[0], p011, 'p011', 'inner');
	const b = await nodejs<{ data: Array<{}> }>('device-management-ygh/zj-000009/s008', {});
	render(fd, b.data[0], p012, 'p012', 'inner');
	console.log(b);
}

